import request from '@/utils/request'

// 查询设备点位配置列表
export function listDeviceDataLocation(query) {
  return request({
    url: '/energy/deviceDataLocation/list',
    method: 'get',
    params: query
  })
}

// 查询设备点位配置详细
export function getDeviceDataLocation(id) {
  return request({
    url: '/energy/deviceDataLocation/' + id,
    method: 'get'
  })
}

// 新增设备点位配置
export function addDeviceDataLocation(data) {
  return request({
    url: '/energy/deviceDataLocation',
    method: 'post',
    data: data
  })
}

// 修改设备点位配置
export function updateDeviceDataLocation(data) {
  return request({
    url: '/energy/deviceDataLocation',
    method: 'put',
    data: data
  })
}

// 删除设备点位配置
export function delDeviceDataLocation(id) {
  return request({
    url: '/energy/deviceDataLocation/' + id,
    method: 'delete'
  })
}


export function otherLocation(deviceId, selfId) {
  return request({
    url: '/energy/deviceDataLocation/otherLocation/' + deviceId + (selfId == null ? '' : "/" + selfId),
    method: 'get'
  })
}
